// 主 js 函数， 必须作为模块引入
const header = document.getElementById("header")
window.addEventListener('scroll', function() {
    if (window.scrollY > 5) header.classList.add("up")
    else header.classList.remove("up")
});
const count = document.getElementById("count-trolley")
count.innerHTML = 0
$.ajax({
    url:"/api/trolleycount",
    method:"post",
    data:{
        uid: GetCookie("id"),
        token: GetCookie("token"),
    },
    success(res){
        count.innerHTML = res.count
    }
})